;(function(){
var role = require("./role");
var BusCon = require("../../core/bus/_con");
var UserCon = require("../../core/user/_con");
var GoodsCon = require("../../core/goods/_con");
var AchCon = require("../../core/ach/_con");
var EvalCon = require("../../core/eval/_con");
var db = require("../../core/db/index");
var config = require("../../core/_include/config");
var ResponObj = require("../_include/responObj");

module.exports = {
	prefix:"/goods/eval",
	get:{
		//用来局部刷新评价
		"/:goods_id":function () {
			var query = this.request.query;
			var goods_id = this.params.goods_id;
			var goods = GoodsCon.get(goods_id);
			if (goods) {
				var evaluations = goods.getEvaluations(query.num,query.page);
				this.body = ResponObj("json",evaluations);
			}else{
				throwCusError("找不到指定商品");
			}
		}
	}
}	
}());